<?php
include("function.php");
init_connect_db();
$question = $_POST['question'];
$answer = $_POST['answer'];
$userId = $_POST['userId'];
$dateCreate = date("Y-m-d H:i:s");
$temp = "INSERT INTO Faqs (id, question, answer, Users_id, dateEdit, dateCreate) VALUES (NULL, '$question', '$answer', '$userId', '$dateCreate', '$dateCreate')";
$query = mysql_query($temp);
if (!$query){
	printf('Could not execut the query');
	exit();
}
$query = mysql_query("SELECT title,id FROM Places");
if (!$query) {
	printf('Could not execut the query');
	exit();
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
?>